home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / XPE3 / OEMSETUP.INF next >
INI File  |  1996-07-31  |  44KB  |  1,414 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMSETUP.INF
  4. ;
  5. ;       Xircom Pocket Ethernet II and III adapter and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ;       davidhov        00-Feb-1992     Created
  9. ;       terryk          27-Feb-1992     Reorganize section location
  10. ;                                       added comment
  11. ;       terryk          03-Mar-1992     Changed to Elink II setup
  12. ;       terryk          02-Apr-1992     Code review changed
  13. ;       davidhov        03-Apr-1992     Enhanced to use new INF section
  14. ;                                       structure from SunilP, et al.
  15. ;       davidhov        06-Dec-1992     Netcard Detection
  16. ;       robertn         02-Jul-1993     Changed for Xircom PE3 without detect
  17. ;       davidlao        28-jun-1995     Added help file.
  18. ;***********************************************************************
  19.  
  20. ;-----------------------------------------------------------------------
  21. ; OPTION TYPE
  22. ; -----------
  23. ; This identifies the Option type we are dealing with.  The different
  24. ; possible types are:
  25. ;
  26. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  27. ;
  28. ;  Types specific to networking:
  29. ;
  30. ; NetAdapter,        a netcard / adapter combination or just a netcard
  31. ; NetDriver,         just a netcard driver
  32. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  33. ; NetService,        an NT networking service
  34. ; NetWork,           a complete network ensemble.
  35. ; NetProvider        a complete network which supports NT MPR protocol
  36. ;-----------------------------------------------------------------------
  37.  
  38. [Identification]
  39.     OptionType = NetAdapter
  40.  
  41. ;-----------------------------------------------------------------------
  42. ; PlatformsSupported
  43. ; ------------------
  44. ; This identifies the platforms supported by the adapter card.
  45. ; Possible types are:
  46. ;
  47. ; ISA, EISA and MCA
  48. ;-----------------------------------------------------------------------
  49.  
  50. [PlatformsSupported]
  51.     ISA
  52.     EISA
  53.     MCA
  54.  
  55. ;-----------------------------------------------------------------------
  56. ; LANGUAGES SUPPORTED
  57. ; -------------------
  58. ;
  59. ; The languages supported by the OEM INF, For every language supported
  60. ; we need to have a separate text section for every displayable text
  61. ; section.
  62. ;
  63. ;-----------------------------------------------------------------------
  64.  
  65. [LanguagesSupported]
  66.     ENG
  67.  
  68. ;-----------------------------------------------------------------------
  69. ; OPTION LIST
  70. ; -----------
  71. ; This section lists the OEM Option key names.  These keys are locale
  72. ; independent and used to represent the option in a locale independent
  73. ; manner.
  74. ;
  75. ;-----------------------------------------------------------------------
  76.  
  77. [Options]
  78.     XCSPE3
  79.  
  80. ;-----------------------------------------------------------------------
  81. ; OPTION TEXT SECTION
  82. ; -------------------
  83. ; These are text strings used to identify the option to the user.  There
  84. ; are separate sections for each language supported.  The format of the
  85. ; section name is "OptionsText" concatenated with the Language represented
  86. ; by the section.
  87. ;
  88. ;-----------------------------------------------------------------------
  89.  
  90. [OptionsTextENG]
  91.     XCSPE3 = "Xircom Pocket Ethernet III"
  92.  
  93. ;***********************************************************************
  94. ; CONSTANTS FOR USING DIALOGS
  95. ;***********************************************************************
  96.  
  97. [FileConstants]
  98.  
  99. ;
  100. ;  File names, etc.
  101. ;
  102. UtilityInf      = "UTILITY.INF"
  103. ParamInf        = "NCPARAM.INF"
  104. subroutineinf   = "SUBROUTN.INF"
  105. SoftwareType    = "driver"
  106. Exit_Code       = 0
  107.  
  108. ;
  109. ; EventLog Message File
  110. ;
  111. NetEventDLL     = "%SystemRoot%\System32\netevent.dll;%SystemRoot%\System32\Drivers\xcspe3.sys"
  112. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  113.  
  114. ; Product Info
  115. ;
  116. Manufacturer    = "Microsoft"
  117. ProductMajorVersion     = "3"
  118. ProductMinorVersion     = "1"
  119. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  120. ;
  121. ; Software
  122. ;
  123. ProductSoftwareName     = "Xcspe3"
  124. ProductSoftwareTitle    = "Xircom Pocket Ethernet III Driver"
  125. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\xcspe3.sys"
  126. NetRuleSoftwareType     = "Xcspe3Sys ndisDriver xcspe3Driver"
  127. NetRuleSoftwareUse      = $(SoftwareType)
  128. NetRuleSoftwareBindForm = """Xcspe3Sys"" yes no container"
  129. NetRuleSoftwareClass    = {"xcspe3Driver basic"}
  130. NetRuleSoftwareBindable = {"xcspe3Driver xcspe3Adapter non exclusive 100"}
  131. ;
  132. ; Hardware
  133. ;
  134. ProductHardwareName     = "Xcspe3"
  135. ProductHardwareXCSPE3Title    = "Xircom Pocket Ethernet III Adapter"
  136. NetRuleHardwareType     = "xcspe3 xcspe3Adapter"
  137. NetRuleHardwareBindForm = " yes yes container"
  138. NetRuleHardwareClass    = {"xcspe3Adapter basic"}
  139. ;
  140. ; Registry Key
  141. ;
  142. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  143. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  144.  
  145.  
  146. [GeneralConstants]
  147. ;
  148. ;  Program flow control variables.
  149. ;
  150. from      = ""
  151. to        = ""
  152. ;
  153. ;  Return codes; Exit_Code is set to one of these
  154. ;
  155. ExitCodeOk     = 0
  156. ExitCodeCancel = 1
  157. ExitCodeFatal  = 2
  158.  
  159. KeyNull         = ""
  160. MAXIMUM_ALLOWED   = 33554432
  161. RegistryErrorIndex = NO_ERROR
  162. KeyProduct      = ""
  163. KeyParameters   = ""
  164.  
  165. TRUE            = 1
  166. FALSE           = 0
  167. NoTitle            = 0
  168.  
  169. ExitState   = "Active"
  170. OldVersionExisted = $(FALSE)
  171.  
  172. DriverPath      = $(!STF_NTPATH)\drivers
  173.  
  174. ;***********************************************************************
  175. ; Language-Dependent Dialog Constants
  176. ;***********************************************************************
  177.  
  178. [FileConstantsENG]
  179. ;
  180. ;  Variables to support thermometer gauge and error dialogs
  181. ;
  182. ProCaption   = "Windows NT Setup"
  183. ProCancel    = "Cancel"
  184. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  185.                "Are you sure you want to cancel copying files?"
  186.  
  187. ProCancelCap = "Network Setup Message"
  188. ProText1     = "Copying:"
  189. ProText2     = "To:"
  190.  
  191. ;
  192. ; Product Info
  193. ;
  194. FunctionTitle   = "Xircom Pocket Ethernet III Adapter Setup"
  195. ;
  196. ; Software
  197. ;
  198. ProductSoftwareDescription          = "Xircom Pocket Ethernet III Adapter Driver"
  199. ;
  200. ; Hardware
  201. ;
  202. ProductHardwareXCSPE3Description    = "Xircom Pocket Ethernet III Adapter"
  203.  
  204. [DialogConstantsENG]
  205. ;
  206. ; Common button names, etc.
  207. ;
  208. Help        = "&Help"
  209. Exit        = "Cancel"
  210. OK          = "OK"
  211. HelpContext = ""
  212. Continue    = "Continue"
  213. Cancel      = "Cancel"
  214.  
  215. [date]
  216.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  217.     ; Minute, Second }
  218.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  219.  
  220.  
  221. ;-----------------------------------------------
  222. ; Input DIALOGS
  223. ;-----------------------------------------------
  224.  
  225. [FileDependentDlgENG]
  226.  
  227. DlgType = "MultiCombo"
  228. DlgTemplate = "NE2000"
  229. Caption = $(FunctionTitle)
  230.  
  231. DlgText = "Please select values for the follwing fields:"
  232.  
  233. Label1 = "&IRQ Level:"
  234. Label2 = "I/&O Port Address:"
  235.  
  236. Combo1List = $(IRQ_List)
  237. Combo1Out  = $(IRQ_Level)
  238. Combo2List = $(IOADDR_Hex_List)
  239. Combo2Out  = $(IOADDR_Hex_Value)
  240.  
  241. ComboListItemsIn  = {Combo1List, Combo2List}
  242. ComboListItemsOut = {Combo1Out, Combo2Out}
  243.  
  244. EditTextIn = ""
  245. EditTextLim = ""
  246. CBOptionsGreyed = {}
  247. NotifyFields = {NO, NO, NO}
  248.  
  249. HelpContext = 100
  250.  
  251. ;---------------------------------------------------------------------------
  252. ; 1. Identify
  253. ;
  254. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  255. ;                as we are choosing currently.
  256. ;
  257. ; INPUT:         None
  258. ;
  259. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  260. ;                $($R1): Option Type (COMPUTER ...)
  261. ;                $($R2): Diskette description
  262. ;---------------------------------------------------------------------------
  263.  
  264. [Identify]
  265.     Set !G:DebugOutputControl = 1
  266.     Set !DebugOutputControl = 1
  267.     Set !STF_DISPLAYDEBUGOUTPUT = 1
  268.     Debug-Output $(STF_CONTEXTINFNAME)": Calling Identification"
  269.     ;
  270.     ;
  271.     read-syms Identification
  272.     Debug-Output $(STF_CONTEXTINFNAME)": Identification set OptionType = "$(OptionType)
  273.  
  274.     set Status     = STATUS_SUCCESSFUL
  275.     set Identifier = $(OptionType)
  276.     set Media      = #("Source Media Descriptions", 1, 1)
  277.  
  278.     Debug-Output $(STF_CONTEXTINFNAME)": Identify returning Status = "$(Status)", Identifier = "$(Identifier)", Media = "$(Media)
  279.     
  280.     Return $(Status) $(Identifier) $(Media)
  281.  
  282. ;------------------------------------------------------------------------
  283. ; 2. ReturnOptions:
  284. ;
  285. ; DESCRIPTION:   To return the option list supported by this INF and the
  286. ;                localised text list representing the options.
  287. ;
  288. ;
  289. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  290. ;
  291. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  292. ;                                STATUS_NOLANGUAGE
  293. ;                                STATUS_FAILED
  294. ;                                STATUS_NOTSUPPORTED
  295. ;
  296. ;                $($R1): Option List
  297. ;                $($R2): Option Text List
  298. ;------------------------------------------------------------------------
  299.  
  300. [ReturnOptions]
  301.     ;
  302.     ;
  303.     set Status        = STATUS_FAILED
  304.     set OptionList     = {}
  305.     set OptionTextList = {}
  306.  
  307.     ;
  308.     ; Check if the language requested is supported
  309.     ;
  310.     set LanguageList = ^(LanguagesSupported, 1)
  311.     Ifcontains(i) $($0) in $(LanguageList)
  312.         ;
  313.         ; Check if the platforms requested is supported
  314.         ;
  315.         ifstr(i) $($1) == ""
  316.                         goto returnoptions
  317.         endif
  318.  
  319.         set PlatformList = ^(PlatformsSupported, 1)
  320.         Ifcontains(i) $($1) in $(PlatformList)
  321.                         goto returnoptions
  322.         else
  323.                         set Status = STATUS_NOTSUPPORTED
  324.                         goto finish_ReturnOptions
  325.         endif
  326.     else
  327.                 set Status = STATUS_NOLANGUAGE
  328.                 goto finish_ReturnOptions
  329.     endif
  330.  
  331.     ;
  332.     ; form a list of all the options and another of the text representing
  333.     ;
  334.  
  335. returnoptions = +
  336.     set OptionList     = ^(Options, 1)
  337.     set OptionTextList = ^(OptionsText$($0), 1)
  338.     set Status         = STATUS_SUCCESSFUL
  339.  
  340. finish_ReturnOptions = +
  341.     Return $(Status) $(OptionList) $(OptionTextList)
  342.  
  343. ;------------------------------------------------------------------------
  344. ;
  345. ; InstallOption:
  346. ;
  347. ;      This section is shelled to by main installation processing
  348. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  349. ;
  350. ;
  351. ; FUNCTION:  To copy files representing Options
  352. ;            To configure the installed option
  353. ;            To update the registry for the installed option
  354. ;
  355. ; INPUT:     $($0):  Language to use
  356. ;            $($1):  OptionID to install
  357. ;            $($2):  SourceDirectory
  358. ;            $($3):  AddCopy  (YES | NO)
  359. ;            $($4):  DoCopy   (YES | NO)
  360. ;            $($5):  DoConfig (YES | NO)
  361. ;
  362. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  363. ;                            STATUS_NOLANGUAGE |
  364. ;                            STATUS_USERCANCEL |
  365. ;                            STATUS_FAILED
  366. ;
  367. ;------------------------------------------------------------------------
  368. [InstallOption]
  369.     ;
  370.     ; Set default values for
  371.     ;
  372.     set Status   = STATUS_FAILED
  373.     ;
  374.     ; extract parameters
  375.     ;
  376.     set Option   = $($1)
  377.     set SrcDir   = $($2)
  378.     set AddCopy  = $($3)
  379.     set DoCopy   = $($4)
  380.     set DoConfig = $($5)
  381.  
  382.     ;
  383.     ; Check if the language requested is supported
  384.     ;
  385.     set LanguageList = ^(LanguagesSupported, 1)
  386.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  387.         Return STATUS_NOLANGUAGE
  388.     endif
  389.  
  390.     set-subst LF = "\n"
  391.  
  392.     read-syms GeneralConstants
  393.     read-syms FileConstants
  394.  
  395.     read-syms DialogConstants$(!STF_LANGUAGE)
  396.     ifstr(i) $(!NTN_Origination) == "NCPA"
  397.         set Continue = "OK"
  398.     endif
  399.     read-syms FileConstants$(!STF_LANGUAGE)
  400.  
  401.     detect date
  402.  
  403.     set-title  $(FunctionTitle)
  404.  
  405.     set to   = Begin
  406.     set from = Begin
  407. ;
  408. ;  Assume all is well.
  409. ;
  410.     set CommonStatus = STATUS_SUCCESSFUL
  411.  
  412.     EndWait
  413.  
  414. ;
  415. ;   Set up the operation-mode-based variables and gaily welcome
  416. ;   the user.  If the "install mode" variable is improperly set,
  417. ;   assume this is a new installation.
  418. ;
  419.  
  420. Begin = +
  421.     Set ActivateDetection = FALSE
  422.  
  423.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  424.         set StartLabel = removeadapter
  425.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  426.         set StartLabel = UpgradeSoftware
  427.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  428.         set StartLabel = bindingadapter
  429.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  430.         set ActivateDetection = TRUE
  431.         set StartLabel = configureadapter
  432.         ;
  433.         ;   You cannot config the software component
  434.         ;
  435.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  436.             Debug-Output "Cannot configure the NI6510 driver software."
  437.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  438.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  439.                 Debug-Output "ShellCode error: cannot get an error string."
  440.                 goto ShellCodeError
  441.             endif
  442.             set Error = $($R0)
  443.             set from = end
  444.             set to = end
  445.             goto nonfatalinfo
  446.         endif
  447.     else
  448.         set ActivateDetection = TRUE
  449.         set StartLabel = installadapter
  450.         set OEM_ABANDON_OPTIONS = {}
  451.         set OEM_ABANDON_SOFTWARE = FALSE
  452.         set OEM_ABANDON_ON = TRUE
  453.     endif
  454.  
  455.  
  456.     ;===================================================
  457.     ;  Netcard Detection logic
  458.     ;
  459.     ;  Initialize use of netcard detection;
  460.     ;  Construct require global parameter variables
  461.     ;
  462.     Debug-Output "OEMSETUP.INF: =================================================="
  463.     Debug-Output "OEMSETUP.INF: STF_CWDIR is: "$(!STF_CWDIR)
  464.     Debug-Output "OEMSETUP.INF: STF_LANGUAGE is: "$(!STF_LANGUAGE)
  465.     Debug-Output "OEMSETUP.INF: Option is: "$(Option)
  466.     Debug-Output "OEMSETUP.INF: !STF_NCDETECT  is: "$(!STF_NCDETECT)
  467.     Debug-Output "OEMSETUP.INF: !STF_NCOPTION  is: "$(!STF_NCOPTION)
  468.     Debug-Output "OEMSETUP.INF: !STF_NCDETCARD is: "$(!STF_NCDETCARD)
  469.     Debug-Output "OEMSETUP.INF: !STF_NCDETINFO is: "$(!STF_NCDETINFO)
  470.     Debug-Output "OEMSETUP.INF: =================================================="
  471.  
  472.     Set DetectedCard = FALSE
  473.  
  474.     Ifstr(i) $(ActivateDetection) != TRUE
  475.         Goto $(StartLabel)
  476.     Endif
  477.     ;
  478.     ;  Set !STF_NC_PARAMS and !STF_NC_PNAMES by calling
  479.     ;    PARAM.INF!Param_BuildTypeLists.
  480.     ;   Pass it a list of the form:
  481.     ;
  482.     ;   {  { <param name>,
  483.     ;        <name of choice list var>,
  484.     ;        <name of default var> },
  485.     ;      ...
  486.     ;   }
  487.     ;
  488.     Set TypeList = {{IRQ, IRQ_List, IRQ_Level},+
  489.                     {IOADDR, IOADDR_Addr_List, IOBaseAddrValue}}
  490.  
  491.     Debug-Output "OEMSETUP.INF: Calling Param_BuildTypeLists"
  492. ;    Shell $(ParamInf) Param_BuildTypeLists $(Option) $(TypeList)
  493. ;    Set Status = $($R0)
  494. ;    ifstr(i) $(Status) != STATUS_SUCCESSFUL
  495. ;        Goto fataldetect
  496. ;    Endif
  497. ;
  498. ; The following code performs the same as above Param_BuildTypeLists
  499. ;
  500.     Set IRQ_List = { 5, 7 }
  501.     Set IOADDR_Addr_List = { 888, 632, 956 }
  502.     Set !STF_NC_PARAMS = { { "IRQ", 1, 0, { 5, 7 } },+ 
  503.                            { "IOADDR", 1, 0, { 888, 632, 956 } } }
  504.     Set !STF_NC_PNAMES = { { "IRQ", "IRQ_Level", 7 },+
  505.                            { "IOADDR", "IOBaseAddrValue", 888 } }
  506.     Set !p:IRQ = { 5, 7 }
  507.     Set !p:IOADDR = { 888, 632, 956 }
  508. ;
  509. ; End of additional code
  510. ;
  511.     Debug-Output "OEMSETUP.INF: Calling Param_SetDefaults"
  512.     Shell $(ParamInf) Param_SetDefaults {}
  513.  
  514.     ;  Establish presentation versions of choice lists.
  515.  
  516.     Shell $(ParamInf) HexListFromDecList $(IOADDR_Addr_List)
  517.     Set IOADDR_Hex_List = $($R0)
  518.  
  519.     ;  If this is a detected card, set the flag.
  520.  
  521.     Ifstr(i) $(!STF_NCDETECT) == YES
  522.         Ifstr(i) $(!STF_NCOPTION) == $(Option)
  523.            Set DetectedCard = TRUE
  524.            Debug-Output "OEMSETUP.INF: Setting DetectedCard to TRUE"
  525.         Endif
  526.     Endif
  527.     ;
  528.     ;  End Netcard Detection logic
  529.     ;===================================================
  530.  
  531.     Shell "" DebugConfiguration "After parameter querying"
  532.  
  533.     Set from = $(fatal)
  534.     Set to = $(fatal)
  535.     Goto $(StartLabel)
  536.  
  537. ;-----------------------------------------------
  538. ; Installation Section
  539. ;-----------------------------------------------
  540.  
  541. installadapter = +
  542. ;
  543. ;   First, check whether the same version of the software exists
  544. ;
  545.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  546.  
  547.     Ifstr $(KeyProduct) != $(KeyNull)
  548.         ;
  549.         ; Same version already existed in the local machine
  550.         ; Popup the dialog and ask the user whether he wants to continue
  551.         ;
  552.         CloseRegKey $(KeyProduct)
  553.  
  554.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  555.            ;
  556.            ; Cannot Install the same software again
  557.            ;
  558.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  559.                $(ProductVersion)
  560.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  561.                Debug-Output "ShellCode error: cannot get an error string."
  562.                goto ShellCodeError
  563.            endif
  564.  
  565.            goto end
  566.         else
  567.            ;
  568.            ; Add a new adapter card?
  569.            ;
  570.            Shell $(UtilityInf), CardExistedDlg
  571.  
  572.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  573.                Debug-Output "ShellCode error: cannot get an error string."
  574.                goto ShellCodeError
  575.            endif
  576.  
  577.            ifstr(i) $($R1) != "OK"
  578.                goto end
  579.            endif
  580.            set OldVersionExisted = $(TRUE)
  581.         endif
  582.     endif
  583.  
  584.     Install "Install-Option"
  585.     ;===================================================
  586.     ;  Netcard Detection logic
  587.     ;
  588.     ;   If this is a detected card, query its parameters
  589.     ;   and merge them into the default list.
  590.     ;
  591.     Ifstr(i) $(DetectedCard) != TRUE
  592.         Goto adaptersetup
  593.     Endif
  594.     ;
  595.     ;   Get the detected parameters
  596.     ;
  597.     StartWait
  598.     Shell $(ParamInf) Param_QueryCard $(!STF_NCDETCARD)
  599.     EndWait
  600.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  601.         Goto adaptersetup
  602.     Endif
  603.     ;
  604.     ;   Merge the detected values in.
  605.     ;
  606.     Set DetectedParams = $($R1)
  607.     Debug-Output "OEMSETUP.INF: Calling Param_SetDefaults to merge detected params"
  608.     Shell $(ParamInf) Param_SetDefaults $(DetectedParams)
  609.     ;
  610.     ;  End Netcard Detection logic
  611.     ;===================================================
  612.  
  613.     goto adaptersetup
  614.  
  615. ;-----------------------------------------------
  616. ; Configuration Section
  617. ;-----------------------------------------------
  618. ;
  619. ;   Get the current values of all the parameters
  620. ;
  621. configureadapter = +
  622.     Ifstr $(KeyProduct) == $(KeyNull)
  623.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  624.         Ifstr $(KeyProduct) == $(KeyNull)
  625.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  626.             Debug-Output "Cannot find component product key"
  627.             goto fatalregistry
  628.         Endif
  629.     Endif
  630.  
  631.     ;
  632.     ; Get the other parameters;  they're attached to the service parameters key
  633.     ;
  634.     Debug-Output "INF: Shelling to FindService"
  635.     Shell $(UtilityInf) FindService, $(KeyProduct)
  636.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  637.         Debug-Output "INF: FindService shell failure"
  638.         Goto ShellCodeError
  639.     Endif
  640.     Ifstr(i) $($R0) != NO_ERROR
  641.         Debug-Output "INF: FindService Shell error: "$($R0)
  642.         Goto fatalregistry
  643.     endif
  644.  
  645.     Set KeyParameters = $($R2)
  646.  
  647.     ;
  648.     ;  We don't need the services key, so close it.
  649.     ;
  650.     CloseRegKey $($R1)
  651.  
  652.     Ifstr $(KeyParameters) == $(KeyNull)
  653.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  654.         Debug-Output "Cannot find component service"
  655.         goto fatalregistry
  656.     endif
  657.  
  658.     set OldVersionExisted = $(TRUE)
  659.  
  660.     set ValueName = ""
  661.     set ValueData = ""
  662.     set ValueStr  = ""
  663.     set ValueList = {}
  664.  
  665.         ;
  666.     ; Get the old values
  667.     ;
  668.     EnumRegValue $(KeyParameters) ValueList
  669.  
  670.     ForListDo $(ValueList)
  671.         set ValueItem = $($)
  672.         set ValueName = *($(ValueItem),1)
  673.         set ValueData = *($(ValueItem),4)
  674.  
  675.         Ifstr(i) $(ValueName) == "InterruptNumber"
  676.             set IRQ_Level = $(ValueData)
  677.         else-Ifstr(i) $(ValueName) == "IOBaseAddress"
  678.             set IOBaseAddrValue = $(ValueData)
  679.         endif
  680.  
  681.     EndForListDo
  682. ;
  683. ;   Put up the adapter configuration dialog if necessary.
  684. ;
  685. adaptersetup = +
  686.  
  687.     Shell "" DebugConfiguration "before displaying dialog"
  688.  
  689.     Set from = adapteroptions
  690.  
  691.     Set IOADDR_Hex_Value = *($(IOADDR_Hex_List), ~($(IOADDR_Addr_List),$(IOBaseAddrValue)))
  692.  
  693.     ;===================================================
  694.     ;  Netcard Detection logic
  695.     ;
  696.     ;   Check that this card's parameters can be
  697.     ;   fully detected.
  698.     ;
  699.     Shell $(ParamInf) Param_ParameterConfidence
  700.     Ifstr(i) $($R0) != STATUS_SUCCESSFUL
  701.         Debug-Output "OEMSETUP.INF: parameter confidence too low to bypass configuration"
  702.         Goto adapteroptions
  703.     Endif
  704.     ;
  705.     ;   If this is a detected card and we're in EXPRESS mode,
  706.     ;   see if the parameters as they currently exist are
  707.     ;   verifiably correct.
  708.     ;
  709.     Ifstr(i) $(DetectedCard) == TRUE
  710.         Ifstr(i) $(!STF_INSTALL_MODE) != CUSTOM
  711.             Goto adapterverify
  712.         Endif
  713.     Endif
  714.     ;
  715.     ;  End Netcard Detection logic
  716.     ;===================================================
  717.  
  718. adapteroptions = +
  719.  
  720.     sethelpfile "xpe3.hlp" 100 100
  721.  
  722.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  723.  
  724.     ui start "InputDlg"
  725.  
  726.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  727.         set IRQ_Level = $(Combo1Out)
  728.         set IOADDR_Hex_Value = $(Combo2Out)
  729.         Set IOBaseAddrValue = *($(IOADDR_Addr_List), ~($(IOADDR_Hex_List),$(IOADDR_Hex_Value)))
  730.  
  731.         ui pop 1
  732.     else-ifstr(i) $(DLGEVENT) == "BACK"
  733.         set CommonStatus = STATUS_USERCANCEL
  734.         Debug-Output "Action: exit. Bye."
  735.         ui pop 1
  736.         goto end
  737.     else
  738.         Debug-Output "Action: unknown. Bye."
  739.         ui pop 1
  740.         goto end
  741.     endif
  742.  
  743. adapterverify = +
  744.  
  745.     Shell "" DebugConfiguration "after running dialog"
  746.  
  747.     ;===================================================
  748.     ;  Netcard Detection logic
  749.     ;
  750.     ;   If this is a detected card, attempt to validate the options
  751.     ;
  752.     Ifstr(i) $(DetectedCard) != TRUE
  753.         Goto skipoptions
  754.     Endif
  755.  
  756.     Debug-Output "OEMSETUP.INF: Calling Param_VerifyCard"
  757.     Shell $(ParamInf) Param_VerifyCard $(!STF_NCDETCARD)
  758.     Ifstr(i) $($R0) == STATUS_SUCCESSFUL
  759.         Debug-Output "OEMSETUP.INF: Param_VerifyCard succeeded"
  760.         Goto skipoptions
  761.     Endif
  762.     ;
  763.     ;   Give the user a chance to retry or force the options given.
  764.     ;
  765.     Set from = adapteroptions
  766.     Set to = skipoptions
  767.     Shell $(UtilityInf),RegistryErrorString,VERIFY_WARNING
  768.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  769.         Debug-Output "ShellCode error: cannot get an error string."
  770.         goto ShellCodeError
  771.     endif
  772.     set Error = $($R0)
  773.     Goto Warning
  774.     ;
  775.     ;  End Netcard Detection logic
  776.     ;===================================================
  777.  
  778. ;
  779. ;   If installing, go create the necessary keys;
  780. ;   if configuring, they're already open.
  781. ;
  782. skipoptions =+
  783.  
  784.     ifint $(OldVersionExisted) == $(TRUE)
  785.         ifstr(i) $(!NTN_InstallMode) == configure
  786.             goto writeparameters
  787.         endif
  788.     endif
  789.     StartWait
  790.     ;
  791.     ; Add Software Component
  792.     ;
  793.     ifint $(OldVersionExisted) == $(FALSE)
  794.         ifstr(i) $(!NTN_InstallMode) == "install"
  795.            Ifstr(i) $(DoCopy) == "YES"
  796.  
  797.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  798.  
  799.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  800.                   Goto ShellCodeError
  801.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  802.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  803.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  804.                       goto ShellCodeError
  805.                   endif
  806.                   set Error = $($R0)
  807.                   Goto fatal
  808.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  809.                   Goto successful
  810.               Endif
  811.  
  812.               Set SrcDir = $($R1)
  813.  
  814.            Endif
  815.  
  816.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  817.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  818.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  819.                   goto ShellCodeError
  820.               endif
  821.               set Error = $($R0)
  822.               goto fatal
  823.            endif
  824.         endif
  825.  
  826.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  827.             $(ProductSoftwareName), +
  828.             $(ProductSoftwareName), +
  829.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  830.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  831.             $(NetEventDLL)
  832.  
  833.         Set OEM_ABANDON_SOFTWARE = TRUE
  834.  
  835.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  836.             Debug-Output "ShellCode error"
  837.             goto ShellCodeError
  838.         endif
  839.         ;
  840.         ;   At this point:
  841.         ;     $R1 contains the product version key handle;
  842.         ;     $R2 contains the NetRules subkey handle;
  843.         ;     $R3 contains the new Services key handle; and
  844.         ;     $R4 contains the Parameters key
  845.         ;     $R5 contains the Linkage Key
  846.         ;
  847.         set RegistryErrorIndex = $($R0)
  848.         set KeyProduct      = $($R1)
  849.         Set SoftNetRulesKey = $($R2)
  850.         CloseRegKey $($R3)
  851.         CloseRegKey $($R4)
  852.         CloseRegKey $($R5)
  853.  
  854.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  855.             EndWait
  856.             Debug-Output "Registry error: add software components"
  857.             CloseRegKey $(KeyProduct)
  858.             CloseRegKey $(SoftNetRulesKey)
  859.             goto fatalregistry
  860.         endif
  861.  
  862.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  863.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  864.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  865.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  866.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  867.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  868.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  869.  
  870.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  871.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  872.             Debug-Output "ShellCode error."
  873.             goto ShellCodeError
  874.         endif
  875.  
  876.         set RegistryErrorIndex = $($R0)
  877.  
  878.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  879.             EndWait
  880.             Debug-Output "Registry error: add value list."
  881.             CloseRegKey $(KeyProduct)
  882.             CloseRegKey $(SoftNetRulesKey)
  883.             goto fatalregistry
  884.         endif
  885.  
  886.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  887.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  888.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  889.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  890.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  891.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  892.  
  893.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  894.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  895.             Debug-Output "ShellCode error."
  896.             goto ShellCodeError
  897.         endif
  898.  
  899.         set RegistryErrorIndex = $($R0)
  900.  
  901.         CloseRegKey $(KeyProduct)
  902.         CloseRegKey $(SoftNetRulesKey)
  903.  
  904.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  905.             EndWait
  906.             Debug-Output "Resgitry error: add value list."
  907.             goto fatalregistry
  908.         endif
  909.     endif
  910. ;
  911. ;   Create the HARDWARE\Netcard region and its corresponding service
  912. ;
  913.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  914.  
  915.     ifint $($R4) != -1
  916.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  917.     endif
  918.  
  919.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  920.         Debug-Output "Cannot add hardware component"
  921.         goto ShellCodeError
  922.     endif
  923.  
  924.     set RegistryErrorIndex = $($R0)
  925.  
  926.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  927.         EndWait
  928.         Debug-Output "Registry error: add hardware component"
  929.         CloseRegKey $($R1)
  930.         CloseRegKey $($R2)
  931.         CloseRegKey $($R3)
  932.         goto fatalregistry
  933.     endif
  934.  
  935. ;
  936. ;   At this point:
  937. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  938. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  939. ;     $R3  Registry key handle for <service>\Parameters key
  940. ;     $R4  Adapter number assigned to adapter
  941. ;     $R5  Service name generated by combining svc name with adapter number
  942. ;
  943.     set KeyParameters = $($R3)
  944.     set KeyAdapterRules = $($R2)
  945.     set AdapterNumber = $($R4)
  946.  
  947.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  948.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  949.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  950.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  951.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  952.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  953.  
  954.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  955.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  956.         Debug-Output "ShellCode error"
  957.         goto ShellCodeError
  958.     endif
  959.  
  960.     CloseRegKey $($R1)
  961.  
  962.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  963.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  964.  
  965.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  966.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  967.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  968.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  969.  
  970.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  971.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  972.         Debug-Output "ShellCode error."
  973.         goto ShellCodeError
  974.     endif
  975.  
  976.     set RegistryErrorIndex = $($R0)
  977.  
  978.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  979.         EndWait
  980.         Debug-Output "Resgitry error: add value list."
  981.         CloseRegKey $(KeyParameters)
  982.         CloseRegKey $(KeyAdapterRules)
  983.         goto fatalregistry
  984.     endif
  985.  
  986.     CloseRegKey $(KeyAdapterRules)
  987.  
  988.     goto writeparameters
  989. ;
  990. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  991. ;
  992. writeparameters = +
  993.     Shell $(UtilityInf), GetBusTypeNum
  994.     set BusTypeNum = $($R1)
  995.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  996.         Debug-Output "ShellCode error."
  997.         goto ShellCodeError
  998.     endif
  999. ;
  1000. ;   Add the rest of the parameters to the Services area
  1001. ;
  1002.     Set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  1003.                        {BusNumber,$(NoTitle),$(!REG_VT_DWORD),0},+
  1004.                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  1005.                        {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQ_Level)},+
  1006.                        {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  1007.                        {VerboseStatus,$(NoTitle),$(!REG_VT_DWORD),1}}
  1008.  
  1009.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1010.  
  1011.     CloseRegKey $(KeyParameters)
  1012.  
  1013.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1014.         Debug-Output "ShellCode error."
  1015.         goto ShellCodeError
  1016.     endif
  1017.  
  1018.     set RegistryErrorIndex = $($R0)
  1019.  
  1020.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1021.         Debug-Output "Registry error: Add value list"
  1022.         goto fatalregistry
  1023.     endif
  1024.  
  1025.     EndWait
  1026.  
  1027.     goto successful
  1028.  
  1029. ;-----------------------------------------------
  1030. ; Binding section
  1031. ;-----------------------------------------------
  1032. bindingadapter =+
  1033.     set Error = "Binding: Sorry, not yet implemented."
  1034.     goto fatal
  1035.  
  1036. ;-----------------------------------------------
  1037. ; Removeadapter section
  1038. ;-----------------------------------------------
  1039.  
  1040. removeadapter = +
  1041.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1042.         ; Remove Software Component
  1043.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1044.             $(ProductSoftwareName)
  1045.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1046.             Debug-Output "ShellCode error"
  1047.             goto ShellCodeError
  1048.         endif
  1049.  
  1050.         set RegistryErrorIndex = $($R0)
  1051.  
  1052.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1053.             goto fatalregistry
  1054.         endif
  1055.     else
  1056.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1057.             $(ProductSoftwareName), $(!NTN_RegBase)
  1058.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1059.             Debug-Output "ShellCode error"
  1060.             goto ShellCodeError
  1061.         endif
  1062.  
  1063.         set RegistryErrorIndex = $($R0)
  1064.  
  1065.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1066.             goto fatalregistry
  1067.         endif
  1068.     endif
  1069.  
  1070.     goto end
  1071.  
  1072. ;-----------------------------------------------
  1073. ; Upgrade Software section
  1074. ;-----------------------------------------------
  1075.  
  1076. UpgradeSoftware = +
  1077.     ;
  1078.     ; First determine whether we want to do upgrade or update for software
  1079.     ; or hardware component. Then we will determine whether the Mode is
  1080.     ; update or upgrade.
  1081.     ;
  1082.     ; If the same version of the product existed in the registry, we do
  1083.     ; update. Otherwise, we will do a upgrade
  1084.     ;
  1085.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1086.         ; Upgrade software component
  1087.         ;
  1088.         ; see whether the same version exist or not
  1089.         ;
  1090.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1091.  
  1092.         Ifstr $(KeyProduct) != $(KeyNull)
  1093.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1094.             set Version = *($(VersionInfo), 4)
  1095.  
  1096.             ;
  1097.             ; Update the binaries
  1098.             ;
  1099.             Split-String $(!NTN_Infname), "\", FilenameList
  1100.             QueryListSize ListSize $(FilenameList)
  1101.             set !UG_Filename = *($(FilenameList), $(ListSize))
  1102.  
  1103.             install "Install-Update"
  1104.             ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1105.                 goto fatal
  1106.             endif
  1107.  
  1108.             ; Upgrade the version number
  1109.             ;
  1110.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1111.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1112.  
  1113.             ;
  1114.             ; do nothing for update
  1115.             ;
  1116.             ifint $(Version) != $(ProductVersion)
  1117.                ;
  1118.                ; If the major version number is not the same,
  1119.                ; it is major upgrade. So let Upgrade the product
  1120.                ;
  1121.                ;
  1122.                ; make other upgrade change if necessary
  1123.                ;
  1124.             endif
  1125.             CloseRegKey $(KeyProduct)
  1126.         else
  1127.             ;
  1128.             ; Cannot Open software key, goto ERROR
  1129.             ;
  1130.             goto fatalregistry
  1131.         endif
  1132.     else
  1133.         ;
  1134.         ; upgrade/update hardware component
  1135.         ; There is no different between upgrade and update for hardware
  1136.         ; component
  1137.         ;
  1138.         ; 1. Get the Service Name
  1139.         ; 2. Change the NetRule section if necessary
  1140.         ;
  1141.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1142.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1143.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1144.             ;
  1145.             ; Get Service name
  1146.             ;
  1147.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1148.             set ServiceName = *($(ServiceNameInfo), 4)
  1149.  
  1150.             ;
  1151.             ; Change the NetRule if necessary
  1152.             ;
  1153.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1154.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1155.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1156.                 ;
  1157.                 ; Make the change....
  1158.                 ;
  1159.             else
  1160.                 ;
  1161.                 ; Error, cannot open net rules key
  1162.                 ;
  1163.                 goto fatalregistry
  1164.             endif
  1165.  
  1166.             CloseRegKey $(NetRules)
  1167.             CloseRegKey $(NetworkCardKey)
  1168.         else
  1169.             ;
  1170.             ; Error, cannot open network card key
  1171.             ;
  1172.             goto fatalregistry
  1173.         endif
  1174.         ;
  1175.         ; 3. Change the service section of the hardware. i.e.,
  1176.         ;    ParameterName change, value change, etc.
  1177.         ;
  1178.         OpenRegKey $(!REG_H_LOCAL) "" +
  1179.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1180.               $(MAXIMUM_ALLOWED) ServiceKey
  1181.  
  1182.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  1183.             ;
  1184.             ; Get the ServiceKey to change the Start value
  1185.             ; or Type value. Or open Parameters key to
  1186.             ; change the hardware parameters if necessary.
  1187.             ;
  1188.             CloseRegKey $(ServiceKey)
  1189.         else
  1190.             ;
  1191.             ; Error, cannot open network card key
  1192.             ;
  1193.             goto fatalregistry
  1194.         endif
  1195.     endif
  1196.  
  1197.     goto end
  1198.     ;
  1199.     ; End of Upgrade Software
  1200.     ;
  1201.  
  1202. ;
  1203. ;  Escape hatches
  1204. ;
  1205. successful = +
  1206.     goto end
  1207.  
  1208. abandon = +
  1209.     ForListDo $(OEM_ABANDON_OPTIONS)
  1210.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1211.             $(ProductSoftwareName), $($)
  1212.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1213.             Debug-Output "ShellCode error"
  1214.             goto ShellCodeError
  1215.         endif
  1216.  
  1217.         set RegistryErrorIndex = $($R0)
  1218.  
  1219.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1220.             goto fatalregistry
  1221.         endif
  1222.     EndForListDo
  1223.  
  1224.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1225.         ; Remove Software Component
  1226.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1227.             $(ProductSoftwareName), FALSE
  1228.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1229.             Debug-Output "ShellCode error"
  1230.             goto ShellCodeError
  1231.         endif
  1232.  
  1233.         set RegistryErrorIndex = $($R0)
  1234.  
  1235.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1236.             goto fatalregistry
  1237.         endif
  1238.     endif
  1239.  
  1240.     goto end
  1241.  
  1242. ;
  1243. ; warning display
  1244. ;
  1245. warning = +
  1246.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1247.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1248.         goto ShellCodeError
  1249.     endif
  1250.     ifstr(i) $($R1) == "OK"
  1251.         goto $(to)
  1252.     else-ifstr(i) $($R1) == "CANCEL"
  1253.         goto $(from)
  1254.     else
  1255.         goto "end"
  1256.     endif
  1257. ;
  1258. ; non fatal error display
  1259. ;
  1260. nonfatalinfo = +
  1261.     Set Severity = STATUS
  1262.     Set CommonStatus = STATUS_USERCANCEL
  1263.     goto nonfatalmsg
  1264. nonfatal = +
  1265.     Set Severity = NONFATAL
  1266.     goto nonfatalmsg
  1267. nonfatalmsg = +
  1268.     ifstr(i) $(Error) == ""
  1269.         Set Severity = NONFATAL
  1270.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1271.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1272.             goto ShellCodeError
  1273.         endif
  1274.         set Error = $($R0)
  1275.     endif
  1276.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1277.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1278.         goto ShellCodeError
  1279.     endif
  1280.     ifstr(i) $($R1) == "OK"
  1281.         goto $(from)
  1282.     else
  1283.         goto "end"
  1284.     endif
  1285.  
  1286. ;
  1287. ;  Registry is broken
  1288. ;
  1289. fatalregistry = +
  1290.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1291.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1292.         goto ShellCodeError
  1293.     endif
  1294.     set Error = $($R0)
  1295.     goto fatal
  1296. ;
  1297. ;  Netcard detection failure
  1298. ;
  1299. fataldetect = +
  1300.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1301.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1302.         Debug-Output "ShellCode error: cannot get an error string."
  1303.         goto ShellCodeError
  1304.     endif
  1305.     set Error = $($R0)
  1306.     Goto fatal
  1307. ;
  1308. ; fatal error display
  1309. ;
  1310. fatal = +
  1311.     ifstr(i) $(Error) == ""
  1312.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1313.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1314.             goto ShellCodeError
  1315.         endif
  1316.         set Error = $($R0)
  1317.     endif
  1318.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1319.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1320.         goto ShellCodeError
  1321.     endif
  1322.  
  1323.     goto setfailed
  1324.  
  1325. ;
  1326. ;  Shelling error
  1327. ;
  1328. ShellCodeError = +
  1329.     set DlgType      = "MessageBox"
  1330.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1331.     set STF_MB_TEXT  = "Shell Code Error"
  1332.     set STF_MB_TYPE  = 1
  1333.     set STF_MB_ICON  = 3
  1334.     set STF_MB_DEF   = 1
  1335.     ui start "Error Message"
  1336.     goto setfailed
  1337.  
  1338. setfailed = +
  1339.     set CommonStatus = STATUS_FAILED
  1340.     ;
  1341.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1342.     ;
  1343.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1344.         set OEM_ABANDON_ON = FALSE
  1345.         goto abandon
  1346.     endif
  1347.     goto end
  1348.  
  1349. end = +
  1350.     goto term
  1351.  
  1352. term = +
  1353.  
  1354.     Return $(CommonStatus)
  1355.  
  1356. [DebugConfiguration]
  1357.  
  1358.     Set InfName = "OEMSETUP.INF"
  1359.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1360.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1361.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1362.  
  1363.     return
  1364.  
  1365.  
  1366. ;***************************************************************
  1367. ;  INSTALL SECTIONS
  1368. ;***************************************************************
  1369. [Install-Option]
  1370.     set STF_VITAL = ""
  1371.  
  1372.     ifstr(i) $(AddCopy) == "YES"
  1373.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1374.         AddSectionFilesToCopyList Files-Help $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1375.     endif
  1376.  
  1377.     ifstr(i) $(DoCopy) == "YES"
  1378.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1379.        CopyFilesInCopyList
  1380.  
  1381.     endif
  1382.  
  1383.     Exit
  1384.  
  1385. [Install-Update]
  1386.    set STF_VITAL        = ""
  1387.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1388.    ;set STF_VERSION     = "YES"
  1389.  
  1390.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1391.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1392.  
  1393.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1394.    CopyFilesInCopyList
  1395.  
  1396.    exit
  1397.  
  1398. [Source Media Descriptions]
  1399.     1  = "Xircom Pocket Ethernet setup disk"
  1400.  
  1401. [Signature]
  1402.     FileType = MICROSOFT_DRVLIB_FILE
  1403. [GetSignature]
  1404.     read-syms Signature
  1405.     return $(FileType)
  1406.  
  1407. [Files-Inf]
  1408. 1,      oemsetup.inf,    SIZE=27002,     RENAME=$(!UG_Filename)
  1409.  
  1410. [Files-XCSPE3]
  1411. 1, XCSPE3.SYS, SIZE=45568
  1412.  
  1413. [Files-Help]
  1414. 1, XPE3.HLP,  SIZE=9999